package com.example.canalclientsync.canal.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

//import javax.persistence.Column;
//import javax.persistence.Id;
import java.util.Date;
import java.util.Set;

/**
 * @author chen.cr
 * @since 2023/9/15
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class Project extends Documentable{

    @TableId
//    @Id
    @Field
    private Integer id;

    //@Column(name = "name")
    @TableField("name")
    @Field(type = FieldType.Text)
    private String name;

    //@Column(name = "create_time")
    @TableField("create_time")
    @Field(type = FieldType.Date)
//    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    //@Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'||yyyy-MM-dd HH:mm:ss||yyyy-MM-dd||epoch_millis")
    private Date createTime;

    //@Column(name = "update_time")
    @TableField("update_time")
    @Field(type = FieldType.Date)
//    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    // @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'||yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    //@Column(name = "create_user_id")
    @TableField("create_user_id")
    @Field(type = FieldType.Keyword)
    private Integer createUserId;

    //@Column(name = "tenant_id")
    @TableField("tenant_id")
    private String tenantId;

    /**项目负责人*/
    @Field(type = FieldType.Keyword)
    private Integer chargeUserId;

    /**项目成员*/
    @Field()
    private Set<Integer> members;

}
